const app = getApp()
const $ = app.globalData
Page({
	data: {

	},
	// 初始化页面
	onLoad: function(options) {
		var that = this
		// 获取订单id
		var orderid = options.id ? options.id : '0'
		that.setData({
			orderid: orderid
		})
		// 获取订单信息
		wx.request({
			url: $.AdminUrl + "/YApi/order_get",
			data: {
				orderid: orderid
			},
			success: function(res) {
				var paytime = res.data.obj.paytime
				paytime = paytime.slice(0, 10)
				that.setData({
					paytime: paytime,
					orderinfo: res.data.obj
				})
				console.log(res)
			}
		})
	},
	// 返回首页
	goindex: function() {
		wx.switchTab({
			url: "/pages/index/index"
		})
	},
	// 申请售后
	shouhou: function(e) {
		var orderid = e.currentTarget.dataset.id
		wx.request({
			url: $.AdminUrl + "/YApi/order_aftersale",
			data: {
				orderid: orderid
			},
			success: function(data) {
				console.log(data)
			}
		})
	},
})
